package com.auto.producta.testcase;

import com.auto.base.factory.JdbcTemplate;
import com.auto.base.util.DubboTemplate;
import com.auto.base.util.MqTemplate;
import com.auto.producta.config.AutoConfig;
import com.auto.producta.model.AutoConfigureDto;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.web.client.RestTemplate;

public class Base {
    public static final AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext(AutoConfig.class);
    public static final JdbcTemplate jdbcTemplate = ctx.getBean(JdbcTemplate.class);
    public static final RestTemplate restTemplate = ctx.getBean(RestTemplate.class);
    public static final DubboTemplate dubboTemplate = ctx.getBean(DubboTemplate.class);
    public static final MqTemplate mqTemplate = ctx.getBean(MqTemplate.class);
    @SuppressWarnings("unchecked")
    public static final RedisTemplate<Object, Object> redisTemplate = ctx.getBean(RedisTemplate.class);
    private static final AutoConfigureDto autoConfigDto = ctx.getBean("getParams", AutoConfigureDto.class);
    protected static String params = autoConfigDto.getParameter1();
}
